<template>
    <div>
        {{ $store.getters.showNum }}
        <button @click="handleCilck">加法</button>
        <button @click="synchandleCilck">加法异步</button>

        <button @click="handleCilckN">加N</button>
        <button @click="asyncSubN">加N异步</button>

    </div>
</template>

<script>
export default {
    data() {
        return {

        }
    },
    methods: {
        handleCilck() {
            this.$store.commit('add')
        },
        handleCilckN(){
            this.$store.commit('addN',8)
        },
        synchandleCilck(){
            this.$store.dispatch('addAsyn')
        },
        asyncSubN(){
            this.$store.dispatch('addAsynN',4)
        }

    },
    created() {

    },
}
</script>
<style scoped></style>